﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Globalization;
using System.Text;
using System.Xml;
using System.Data.Common;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.Data.Sql;
using EQT.Model;

namespace EQT.Dal
{
    public partial class DaEquip
    {

        public DataSet GetEquipmentRecords(string condition, int PageSize, int PageIndex, out int TotalCount)
        {

            string strGetEmploreeRecords = "select * from Equip ";

            if (!string.IsNullOrEmpty(condition))
            {
                strGetEmploreeRecords = strGetEmploreeRecords + condition;
            }

            try
            {
                return DaCommon.GetPaginationData(strGetEmploreeRecords, PageSize, PageIndex, " Equip_ID desc", out TotalCount);

            }
            catch (DbException ex)
            {
                HandleDbException(ex);
            }
            TotalCount = 0;
            return new DataSet();
        }

        public DataSet GetEquipmentReminds(string condition, int PageSize, int PageIndex, out int TotalCount)
        {

            string strGetEmploreeRecords = "select * from V_Equip_Remind ";

            if (!string.IsNullOrEmpty(condition))
            {
                strGetEmploreeRecords = strGetEmploreeRecords + condition;
            }

            try
            {
                return DaCommon.GetPaginationData(strGetEmploreeRecords, PageSize, PageIndex, " Equip_ID desc", out TotalCount);
            }
            catch (DbException ex)
            {
                HandleDbException(ex);
            }
            TotalCount = 0;
            return new DataSet();
        }
    }
}

